package com.hnkywl.sts.service.report;

import com.google.gson.Gson;
import com.hnkywl.sts.dao.report.BzjlxfpDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by ccr on 2014/5/19.
 */
@Service
public class BzjlxfpService {
    private BzjlxfpDao bzjlxfpDao;

    public String bzjlxfpList(Long gsId,Long khId,String htbm,int pageNo,int pageSize){
        Map<String,Object> map = bzjlxfpDao.bzjlxfpList(gsId,khId,htbm,pageNo,pageSize);
        return "{\"total\":"+map.get("count")+",\"rows\":"+new Gson().toJson(map.get("rows"))+",\"footer\":"+new Gson().toJson(map.get("footer"))+"}";
    }

    public Map<String,Object> bzjlxfpListExport(Long gsId,Long khId,String htbm,int pageNo,int pageSize){
        Map<String,Object> map = bzjlxfpDao.bzjlxfpList(gsId,khId,htbm,pageNo,pageSize);
        return map;
    }

    @Autowired
    public void setBzjlxfpDao(BzjlxfpDao bzjlxfpDao) {
        this.bzjlxfpDao = bzjlxfpDao;
    }
}
